package cn.iocoder.yudao.module.trade.dal.dataobject.ordersafetychecktemplateitem;

import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.module.trade.controller.admin.ordersafetycheckterm.vo.OrderSafetyCheckTermSaveReqVO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import javax.validation.constraints.NotEmpty;
import java.util.List;
import java.util.Objects;

/**
 * 安全检查明细 DO
 *
 * @author 芋道源码
 */
@TableName("trade_order_safety_check_template_item")
@KeySequence("trade_order_safety_check_template_item_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库，可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class OrderSafetyCheckTemplateItemDO extends BaseDO {

    /**
     * id
     */
    @TableId
    private Long id;
    /**
     * 安检服务id
     */
    private Long templateId;
    /**
     * 标题
     */
    private String title;

    /**
     * 排序
     */
    private Integer sort;

    private Integer idIndex;

    private Integer status;

    @TableField(exist = false)
    private List<OrderSafetyCheckTermSaveReqVO> termSaveReqVOList;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        OrderSafetyCheckTemplateItemDO that = (OrderSafetyCheckTemplateItemDO) o;
        return Objects.equals(title, that.title);
    }
    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), title);
    }
}